private function Equality(time1, time2) result(isEqual)
return true
if time1 is equal to time2. Before comparison, dates are
converted to UTC
Arguments
Type |
Intent | Optional | Attributes |
|
Name |
|
type(DateTime),
|
intent(in) |
|
|
:: |
time1 |
|
type(DateTime),
|
intent(in) |
|
|
:: |
time2 |
|
Return Value
logical
Variables
Type |
Visibility | Attributes |
|
Name |
| Initial | |
type(DateTime),
|
public |
|
:: |
tempTime1 |
|
|
|
type(DateTime),
|
public |
|
:: |
tempTime2 |
|
|
|
Source Code
FUNCTION Equality &
!
(time1, time2) &
!
RESULT (isEqual)
IMPLICIT NONE
! Arguments with intent(in):
TYPE (DateTime), INTENT(IN) :: time1, time2
! Local declarations:
LOGICAL :: isEqual
TYPE (DateTime) :: tempTime1, tempTime2
!------------end of declaration------------------------------------------------
!converto to utc
tempTime1 = ToUtc (time1)
tempTime2 = ToUtc (time2)
!perform comparison
IF( tempTime1 % year == tempTime2 % year .AND. &
tempTime1 % month == tempTime2 % month .AND. &
tempTime1 % day == tempTime2 % day .AND. &
tempTime1 % hour == tempTime2 % hour .AND. &
tempTime1 % minute == tempTime2 % minute .AND. &
tempTime1 % second == tempTime2 % second ) THEN
isEqual = .TRUE.
ELSE
isEqual = .FALSE.
END IF
END FUNCTION Equality